# -*- encoding=utf8 -*-
__author__ = "Simon"
from airtest.core.api import *
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
using("../main.air")
import main

def egg2():
    #获取旋转后的分辨率
    x,y=device().get_current_resolution()
    sleep(1)
    #判断是否在主页
    main.judge_sheet(x,y)
    sleep(1)
    main.egg_entry(x,y)
    sleep(1)
    touch(Template(r"tpl1596791676281.png",threshold=0.6))
    #判断是否完成抽取
    if exists(Template(r"tpl1596792301710.png",threshold=0.9)):
        print("扭蛋cd中...")
        sleep(1)
    else:
        touch([0.75*x,0.65*y])
        sleep(2)
        main.cilck_blue_ok()
        sleep(2)
        main.cilck_white_ok()
        sleep(2)
    main.sheet_entry(x,y)
    sleep(2)